<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<h3>人的对象：fisrtname,lastname,age,fullname1()方法，</h3>
		<h3>动态添加：address(属性)，fullname2()()函数</h3>
		<script>
			var person={
				fistname:"廖",
				lastname:"朝勇",
				age:18,
				fullname1:function(){
					//函数里不能直接访问对象属性，加this关键字
					return this.fistname+this.lastname;
				}
			}
			console.log(person);
			console.log(person.fistname);
			console.log(person.age);
			console.log(person.fullname1());
			
			//动态添加
			person.address="四川";
			person.fullname2=function(){
				return person.fistname+person.lastname+","+person.age;
			}
			console.log(person);
			console.log(person.fullname2);
		</script>
	</body>
</html>
